using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EEPNetServer
{
    public partial class frmAlarm : Form
    {
        private Int32 i = 60;

        public frmAlarm()
        {
            InitializeComponent();

            timer1.Interval = 1000;
            timer1.Start();
            timer1.Tick += new EventHandler(ShowSecond);
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void ShowSecond(Object myObject, EventArgs myEventArgs)
        {
            i -= 1;

            if (i >= 0)
            {
                lblSecond.Text = i.ToString();
                Application.DoEvents();
            }
            else
            {
                Application.Exit();
            }
        }

        private void frmAlarm_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }
    }
}